// CalculaterClient.cc
#include "CalculatorClient.hpp"
#include <memory>
#include <string>
// 显式提醒怎么启动客户端
void Usage(const string &proc)
{
    printf("Usage:\n\t%s serverip serverport\n", proc.c_str());
}
int main(char argc, char *argv[])
{
    //保证客户端的正确启动
    if (argc != 3)
    {
        Usage(argv[0]);
        LogMessage(Fatal, "input form error");
        exit(USE_ERR);
    }
    
    //debug
    //cout << argv[1] << " " << argv[2] << endl;


    unique_ptr<CalculatorClient> client(new CalculatorClient);
    
    //客户端初始化
    client->Init();

    //启动客户端
    string serverip(argv[1]);
    uint16_t serverport=atoi(argv[2]);
    client->Start(serverip, serverport);

    return 0;
}